$(document).ready(function(){  
  $('#edit').click(function() { // Handle the event when the 'view record' button is clicked   
    $("#change").load('../profile/editprofile.php', function() {
      $('#editprofile').ajaxForm(formAddRecordOptions); // Bind the form      
    }); // Load the record and the form into tab 2  
    $('.selected').removeClass('selected');    
    $("#edit").addClass('selected');
  });
});

$(document).ready(function(){  
  $('#view').click(function() { // Handle the event when the 'view record' button is clicked
    $(location).attr('href','../profile/viewprofile.php');
    $('.selected').removeClass('selected');    
    $("#view").addClass('selected');
  });
});